<!DOCTYPE html>
<html class="um landscape min-width-240px min-width-320px min-width-480px min-width-768px min-width-1024px">
  <head>
    <title></title>
    <meta charset="utf-8">
    <meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
	<link rel="stylesheet" href="css/custom/reset.css">
    <link rel="stylesheet" href="css/ui-base.css">
    <link rel="stylesheet" href="css/ui-box.css">
    <link rel="stylesheet" href="css/ui-color.css">
	<link rel="stylesheet" href="css/ui-res.css">
	<link rel="stylesheet" href="css/ui-media.css">
	<link rel="stylesheet" href="css/custom/base_640.css">
	<script src="js/jquery-1.8.0.min.js"></script>
    <script src="js/zy_control.js">
    </script>
    <script src="js/zy_click.js">
    </script>
	<script src="js/zy_event.js">
    </script>
	<script src="js/zy_anim.js">
    </script>
	<script src="js/guoguojie.js">
    </script>
	<script src="js/default_unit.js" type="text/javascript"></script>
    <script>
    </script>
  </head>
<body class="um-vp" ontouchstart>
	 <div class="content uabs ub-fh utra" id="items">
    	<div class="pd_s3">
    		<div class="pro_box">
    			<div class="before_pro">
    				<a href="javascript:;" onclick="loadprodetailpre();"><img src="images/icon_9.png" /></a>
    			</div>
				<div class="pro_det_box">
					<div class="pro_det">
						<a href="javascript:;" class="pic" onclick="totaobaobuy();"><img  id="pro_picUrl"/></a>
						<a href="javascript:;" class="title" id="pro_name" onclick="totaobaobuy();"></a>
						<a href="javascript:;" class="buy" id="pro_price" onclick="totaobaobuy();"></a>
						<br class="clear" />
					</div>
				</div>
				<div class="after_pro">
					<a href="javascript:;" onclick="loadprodetailnext();"><img src="images/icon_8.png" /></a>
				</div>	
    		</div>
			
			
    	</div>
		<div class="comment_box">
			<div class="triangle"></div>
			<div class="pd_s4">
				<div class="comment_det">
					<ul id="comment_ul">
					</ul>
				</div>
			</div>		
		</div>
    </div>
</body>
<script>

zy_init();
window.uexOnload=function(type)
{
	if(!type){
		uexWindow.setBounce("1");
		uexWindow.showBounceView("0","#FFF","0");
		uexWindow.showBounceView("1","#FFF","0");
		uexWindow.notifyBounceEvent("1","1");
      
	 
	  
	  if(window.localStorage){
	  		uexWindow.toast(1, 5, "正在加载请稍后", 0);
			var proId = localStorage.getItem("proId");
			var ajaxId = Math.floor(Math.random() * 100);
			var url = domainName+"mobile/prodetail.htm";
			uexXmlHttpMgr.open(ajaxId, 'POST', url, 20000);
			uexXmlHttpMgr.setPostData(ajaxId, "0", "proId", proId);
			uexXmlHttpMgr.onData = function(opcode, status, data){
				uexWindow.closeToast();
				if (status == -1){
					alert('网络连接出错，请检查网络!');
				}else if (status == 1){
					var ret = $.parseJSON(data);
					if(ret.success == 'true'){
						$("#pro_picUrl").attr("src",ret.picUrl+"_468xXXX.jpg");
						$("#pro_name").text(ret.name);
						$("#pro_price").text('￥'+ret.price).append("<i>去购买</i>");
						loadComment();
					}else{
						uexWindow.alert('错误','得到产品失败','确定');
					}
							
					uexXmlHttpMgr.close(ajaxId);
				}
			}
			uexXmlHttpMgr.send(ajaxId);
			
			
			
			
		}
	}
	
	
	
}
var page = 1;
function loadComment(){
	var doingId = localStorage.getItem("doingId");
	var ajaxId2 = Math.floor(Math.random() * 100);
	var url = domainName+"mobile/getcomment.htm";
	uexXmlHttpMgr.open(ajaxId2, 'POST', url, 20000);
	uexXmlHttpMgr.setPostData(ajaxId2, "0", "doingId", doingId);
	uexXmlHttpMgr.setPostData(ajaxId2, "0", "page", page);
	uexXmlHttpMgr.onData = function(opcode, status, data){
		if (status == -1){
			alert('网络连接出错，请检查网络!');
		}else if (status == 1){
			var ret = $.parseJSON(data);
			if(ret.success == 'true'){
				page+=1;
				$.each(ret.list,function(index,item){
					var cli = '<li><a href="javascript:;" class="pic"><img src="'+item.avatar+'" /></a><div class="r_box">'+
						'<p class="top_info"><a href="javascript:;" class="name">'+item.username+'</a> <span class="time">'+item.createTime+'</span></p>'+
						'<p class="info">'+item.content+'</p></div></li>'
					
					$("#comment_ul").append(cli);
				});
			}else{
				uexWindow.alert('错误','得到评论失败','确定');
			}
					
			uexXmlHttpMgr.close(ajaxId2);
		}
	}
	uexXmlHttpMgr.send(ajaxId2);
}

function loadprodetailcontent(mobilemove){
	uexWindow.toast(1, 5, "正在加载请稍后", 0);
	var doingId = localStorage.getItem("doingId");
	var ajaxId = Math.floor(Math.random() * 100);
	var url = domainName+"mobile/mobilemove.htm";
	uexXmlHttpMgr.open(ajaxId, 'POST', url, 20000);
	uexXmlHttpMgr.setPostData(ajaxId, "0", "currentDoingId", doingId);
	uexXmlHttpMgr.setPostData(ajaxId, "0", "mobileMove", mobilemove);
	uexXmlHttpMgr.onData = function(opcode, status, data){
		uexWindow.closeToast();
		if (status == -1){
			alert('网络连接出错，请检查网络!');
		}else if (status == 1){
			var ret = $.parseJSON(data);
			if(ret.success == 'true'){
				localStorage.setItem("doingId",ret.doingId);
				localStorage.setItem("proId",ret.proId);
				location.href="pro_detail_content.html";
			}else{
				uexWindow.toast(1, 5, "已经没有产品了", 1000);
			}
			uexXmlHttpMgr.close(ajaxId);
		}
	}
	uexXmlHttpMgr.send(ajaxId);
}

function loadprodetailpre(){
	loadprodetailcontent('pre');
}

function loadprodetailnext(){
	loadprodetailcontent('next');
}

</script>
</html>
